﻿@{
    ViewBag.Title = "已办事宜";
    Layout = "~/Views/Shared/_WorkListLayout.cshtml";
}
@model List<Wicresoft.SelfService.DAO.ServiceDetail>
<script type="text/javascript">

    $(function () {
        var pager = new PagerView('pager');
        pager.itemCount = parseInt($("input#itemCount").val(), 10);
        pager.size = parseInt($("input#size").val(), 10);
        pager.index = parseInt($("input#index").val(), 10);
        pager.onclick = function (index) {
            $("input#index").val(index);
            getDoneWorkList(2);
        };
        getDoneWorkList(2);
        pager.render();
    });
</script>
<script src="@Url.Content("~/Scripts/WorkListJs/DoneWorkList.js")" type="text/javascript"></script>
<div class="right_title">
    工作列表 → 已办事宜</div>
<div class="right_box_top ui-icons">
</div>
<div class="right_box_bg">
    <div class="right_box">
        <div class="decoP">
            <div class="box_bg_decoP_B">
                <div class="border_line">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tbody>
                            <tr>
                                <td width="20%" class="tdName">
                                    申请单号
                                </td>
                                <td width="30%" class="tdData">
                                    <input class="InputStyle1" type="text" id="requestID" />
                                </td>
                                <td width="20%" class="tdName">
                                    申请单状态
                                </td>
                                <td width="30%" class="tdData">
                                    <select class="InputStyle1" id="status">
                                        <option value="0">---全部---</option>
                                        <option value="1">审批中</option>
                                        <option value="2">等待中</option>
                                        <option value="3">处理中</option>
                                        <option value="4">已完成</option>
                                        <option value="5">已拒绝</option>
                                        <option value="6">已取消</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td width="20%" class="tdName">
                                    服务类别
                                </td>
                                <td width="30%" class="tdData">
                                    <select class="InputStyle1" id="serviceType" />
                                    <option value="0">请选择</option>
                                    </select>
                                </td>
                                <td width="20%" class="tdName">
                                    申请单描述
                                </td>
                                <td width="30%" class="tdData">
                                    <input class="InputStyle1" type="text" id="description" />
                                </td>
                            </tr>
                            <tr>
                                <td width="20%" class="tdName">
                                    提交人
                                </td>
                                <td width="30%" class="tdData">
                                    <input class="InputStyle1" type="text" id="approveOwner" />
                                </td>
                                <td width="20%" class="tdName">
                                    提交时间(起始)
                                </td>
                                <td width="30%" class="tdData">
                                    <input class="InputStyle1" type="text" id="startTime" />
                                </td>
                            </tr>
                            <tr>
                                <td width="20%" class="tdName">
                                    提交时间(结束)
                                </td>
                                <td width="30%" class="tdData">
                                    <input class="InputStyle1" type="text" id="endTime" />
                                </td>
                                <td width="20%" class="tdData">
                                    &nbsp;
                                </td>
                                <td width="30%" class="tdData">
                                    <input class="Button_paging" id="search_submit" title="查询" value="查询" type="button" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div style="height: 200px;">
                <table class="MSGridView" cellpadding="0" cellspacing="1" border="0" width="100%"
                    id="List">
                    <tbody>
                        <tr>
                            <th>
                                申请单号
                            </th>
                            <th>
                                服务类别
                            </th>
                            <th>
                                申请单描述
                            </th>
                            <th>
                                申请单状态
                            </th>
                            <th>
                                当前处理人
                            </th>
                            <th>
                                提交人
                            </th>
                            <th>
                                提交时间
                            </th>
                        </tr>
                        @foreach (Wicresoft.SelfService.DAO.ServiceDetail mySD in Model)
                        {
                            <tr class="AlternatingRowStyle">
                                <td>
                                    @mySD.serviceRequestID
                                </td>
                                <td>
                                    @{
                                        var sername = mySD.serviceType.serviceName;

                                        if (sername.Length > 10)
                                        {
                                            sername = string.Concat(sername.Substring(0, 8), "..");
                                        }
                                    }
                                    @sername
                                </td>
                                <td>
                                    @{
                               var desc = string.Empty;
                               if (mySD.description.Length > 0)
                               {
                                   if (mySD.description.Length > 20)
                                   {
                                       desc = string.Concat(mySD.description.Substring(0, 20), "...");
                                   }
                                   else
                                   {
                                       desc = mySD.description;
                                   }
                               }
                               else
                               {
                                   if (mySD.BDDescription.Length > 20)
                                   {
                                       desc = string.Concat(mySD.BDDescription.Substring(0, 20), "...");
                                   }
                                   else
                                   {
                                       desc = mySD.BDDescription;
                                   }
                               }
                                    }
                                    @desc
                                </td>
                                <td>
                                    @Enum.GetName(typeof(Wicresoft.SelfService.DAO.serviceStatusView), mySD.stauts)
                                </td>
                                <td>
                                    @{
                               var CurrPro = string.Empty;
                               if (mySD.CurrentProcessor != null)
                               {
                                   if (mySD.stauts != 4 && mySD.stauts != 5 && mySD.stauts != 6)
                                   {
                                       CurrPro = mySD.CurrentProcessor;
                                   }
                                   else
                                   {
                                       CurrPro = "无";
                                   }

                               }
                               else
                               {
                                   CurrPro = "无";
                               }
                                    }
                                    @CurrPro
                                </td>
                                <td>
                                    @mySD.account.userName
                                </td>
                                <td>
                                    @mySD.createTime
                                </td>
                            </tr>                           
                        }
                    </tbody>
                </table>
                <div id="pager">
                </div>
            </div>
        </div>
    </div>
</div>
<p>
    <input type="hidden" id="itemCount" value=@ViewData["count"]/>
    <input type="hidden" id="size" value=@ViewData["size"]/>
    <input type="hidden" id="index" value=@ViewData["index"]/>
</p>
<div class="right_box_down ui-icons">
</div>
